//
//  SDKClient.h
//  SXIoTSDK
//
//  Created by ShimLin on 2019/5/27.
//  Copyright © 2019 ShimLin. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GateWayInfo.h"
#import "OnDeviceStudyListener.h"
#import "CacheGateway.h"
#import "DownProfileInfo.h"
#import "SDKResult.h"
#import "CateDev.h"
#import "SXSceneInfo.h"
#import "SXSceneAction.h"
#import "SXSceneCondition.h"

#ifndef DeviceClient_h
#define DeviceClient_h

@interface DeviceClient : NSObject

//触发获取设备状态信息，通过监听函数回调
+ (NSString*) getModelByDeviceType:(NSString*)deviceType;
+ (CacheGateway*) getGatewayStatCache:(NSString*)zkId;
+ (void) cacheDevStat:(DeviceInfo*)deviceInfo param:(NSDictionary<NSString*, id>*)param;
+ (void) downloadProfilesByZkId:(NSString*)zkId pass:(NSString*)pass callback:(void(^)(NSString* result, NSError* error))callback;
+ (void) uploadProfilesByZkId:(NSString*)zkId pass:(NSString*)pass callback:(void(^)(NSString* result, NSError* error))callback;
+ (void)queryDeviceStatus:(DeviceInfo*) deviceInfo;
+ (void)queryDeviceStatusByDevList:(NSArray<DeviceInfo*>*) deviceInfoList;
+ (void)queryDeviceStatusByRoomId:(NSInteger) roomId;
+ (void)queryDeviceStatusByZkIdInRoom:(NSString*)zkId roomId:(long)roomId;
+ (void)connectGateway:(GateWayInfo*)gatewayInfo;
+ (void)connectGateways:(NSArray<GateWayInfo*>*) gatewayInfos;
+ (NSDictionary<NSString*, id>*)getStatusCacheById:(long)deviceId;
+ (void)onNetStatChange;
+ (void)searchGatewayLocal;
+ (void)checkGatewayPass:(NSString*)zkId pass:(NSString*)zkPass callback:(void(^)(SDKResult* result, NSError* error))callback;
+ (void)localConnectGateway:(NSString*)zkId pass:(NSString*)zkPass callback:(void(^)(SDKResult* result, NSError* error))callback;
+ (void)connectGatewayById:(NSString*)zkId pass:(NSString*)zkPass callback:(void(^)(SDKResult* result, NSError* error))callback;
//+ (NSDictionary<NSString*, id>*)getFunDeviceCache;
//+ (void)triggerRefreshFunDevCache;
+ (void)wifiDeviceConnect:(NSString*) ssid password:(NSString*)password;
+ (void)wifiDeviceJoinNet:(NSString*) ssid withPassword:(NSString*) password
                 sendSsid:(NSString*) sendSsid andPassword:(NSString*) sendPassword
               onComplete:(void (^)(NSError* error)) onComplete;
+ (void) removeStudyStatus:(NSInteger)deviceId zkId:(NSString*)zkId;
+ (void) removeDevice:(NSInteger)deviceId zkId:(NSString*)zkId callback:(void(^)(DeviceInfo* result, NSError* error))callback;
+ (void) createAndAddDev:(DeviceInfo*) deviceInfo callback:(void(^)(DeviceInfo* result, NSError* error))callback;
+ (void) enabledGateway:(NSString*)zkId enable:(BOOL)enable;
+ (void) disabledGateway:(NSString*)zkId;
+ (void) enabledSingleGateway:(NSString*)zkId;
+ (void) enabledMultiGateway:(NSString*)zkId count:(int)count;
+ (void) runSoftScene:(NSInteger)sceneId zkId:(NSString*)zkId;
+ (void) downTotalScene:(NSInteger)sceneId zkId:(NSString*)zkId callback:(void(^)(NSString* result, NSError* error))callback;
+ (void) runHardScene:(NSInteger)sceneId zkId:(NSString*)zkId;
+ (void) handleNetworkChange:(NSInteger)networkType;
+ (void) handleDownNewJs:(void(^)(NSString* result, NSError* error))callback;
+ (void) handleSaveSceneInfo:(SXSceneInfo*)sceneInfo actionList:(NSArray<SXSceneAction*>*)actionList conditionList:(NSArray<SXSceneCondition*>*)conditionList callback:(void(^)(NSString* result, NSError* error))callback;
+ (void) clear407Gateway:(NSString*)zkId callback:(void(^)(NSString* result, NSError* error))callback;
+ (void) delSceneAndClearZK:(NSInteger)sceneId zkId:(NSString*)zkId callback:(void(^)(NSString* result, NSError* error))callback;
+ (NSString*) getShareQrCodeStr:(NSString*)zkId;
+ (GateWayInfo*) getGatewayInfoByShareQrCode:(NSString*)qrCode;
+ (void) query407ZigbeeInfo:(NSString*)zkId callback:(void(^)(NSDictionary<NSString*, id>* result, NSError* error))callback;

@end

#endif /* SDKClient_h */
